package com.example.my_music_palyer.common.tools;

import com.mpatric.mp3agic.InvalidDataException;
import com.mpatric.mp3agic.Mp3File;
import com.mpatric.mp3agic.UnsupportedTagException;
import org.springframework.stereotype.Controller;

import java.io.IOException;

@Controller
public class Mp3Agic {

    public boolean isMp3(String path) throws InvalidDataException, UnsupportedTagException, IOException {
        Mp3File mp3File = new Mp3File(path);
        if(mp3File.hasId3v1Tag() || mp3File.hasId3v2Tag()) {
            return true;
        }
        return false;
    }

}
